package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.Point;
import cn.wolfcode.trip.base.service.IPointService;
import cn.wolfcode.trip.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/point")
public class PointController {
    @Autowired
    private IPointService pointService;
    //每天签到加50积分
    @PostMapping("/dailyUpdate")
    public JSONResult saveAnswer(Point point){
        //新增
        pointService.dailyUpdate(point);
        return new JSONResult();
    }
    //连续签到加300积分
    @PostMapping("/seriesUpdate")
    JSONResult seriesUpdate(Point point) {
        pointService.seriesUpdate(point);
        return new JSONResult();
    }
}
